package day19;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;

public class Deserialize {
	public static void main(String [] args){
		Employee e = null;
		
			
		try {
			FileInputStream fileIn = new FileInputStream("e:/employee.ser");
			ObjectInputStream in = new ObjectInputStream(fileIn);
			e = (Employee) in.readObject();
			in.close();
			fileIn.close();
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
			return;
		}catch (ClassNotFoundException c){
			System.out.println("Employee class not found");
			c.printStackTrace();
			return;
		}
		System.out.println("Deserialized Employee...");
		System.out.println("Name:"+e.name);
		System.out.println("address:"+e.address);
		System.out.println("SSN:"+e.SSN);
		System.out.println("number:"+e.number);
	}
}
